﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace YuShiManageSystem.UI.Card
{

    public partial class CombineCard : YuShiManageSystem.UI.Base
    {
        private static BindingList<TestClass> lst = new BindingList<TestClass>();
        
        
        public CombineCard()
        {
            InitializeComponent();
            //this.AddRow.Text = "asdfasdf";
            //this.Text = this.AddRow.Text;
           
        }

        private void Form1_Load(object sender, EventArgs e)
        {
        //    this.comboBox1df.SelectedIndex = this.comboBox2.SelectedIndex = this.comboBox3.SelectedIndex = 0;
          //  this.dataGridView1.DataSource = lst;
        }

        private void button4_Click(object sender, EventArgs e)
        {
            
            //lst.Add(new TestClass(this.cmbPayMode.Text,
            //                       (float)this.UpDownMoney.Value,
            //                      this.txtRemark.Text));
            //this.PayInfo.DataSource = new List<TestClass>();
            //this.PayInfo.DataSource = lst;
            //TotalMoney();
            //this.cmbPayMode.SelectedIndex = -1;
            //this.txtRemark.Clear();
            //this.UpDownMoney.Value = 0;
        }

        private void TotalMoney()
        {
            float total = 0.0f;
            foreach (TestClass tc in lst)
            {
                total += tc.Money;
            }
            //toolStripStatusLabel3.Text = total.ToString();
        }

        private void dataGridView2_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void AAddRow_Click(object sender, EventArgs e)
        {
            //this.PayInfo.AllowUserToAddRows = true;
            //this.PayInfo.
        }

        private void PayInfo_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            
            //DataGridViewRow row = this.PayInfo.SelectedRows[0];
            //this.cmbPayMode.Text = row.Cells[0].Value.ToString();
            //this.UpDownMoney.Value  = Convert.ToDecimal(row.Cells[1].Value);
            //this.txtRemark.Text = row.Cells[2].Value.ToString();
                

        }

        private void btnDel_Click(object sender, EventArgs e)
        {
            //if (this.PayInfo.SelectedRows.Count == 0) return;
            //this.PayInfo.Rows.Remove(this.PayInfo.SelectedRows[0]);
            //TotalMoney();
        }
    }
    public class TestClass
    {
        public string PayMode { get; set; }
        public float Money { get; set; }
        public string Remark { get; set; }
        public TestClass(string sort, float money, string remark)
        {
            this.PayMode = sort;
            this.Money = money;
            this.Remark = remark;
            
        }
    }
}
